package org.jet.emall.common.constant;

import lombok.Getter;

/**
 * @author xiaozai
 * @version 1.0
 * @date 2020-04-30 11:58
 */
public enum  OrderStatusValue {

    /**
     *
     */
    UNPAID((byte)0,"未支付"),
    PAID((byte)1, "已支付"),
    PRINTING((byte)2, "已打印"),
    OUTING((byte)3,"正在出库"),
    SCANNING((byte)4, "正在扫描"),
    PACKAGING((byte)5,"正在打包"),
    SHIP((byte)6,"正在运送中"),
    COMPLETE((byte)7, "订单已完成"),
    ON_CANCEL((byte)8,"取消审核中"),
    CANCELED((byte)9,"已审核通过"),
    CANCEL_FAIL((byte)10,"取消审核不通过");


    // 说明信息
    @Getter
    private String info;
    // 值
    @Getter
    private Byte value;


    private OrderStatusValue(Byte value,String info){
        this.info = info;
        this.value = value;
    }

    public static OrderStatusValue valueOf(Byte value ){
        switch (value){
            case 0: return UNPAID;
            case 1: return PAID;
            case 2: return PRINTING;
            case 3: return OUTING;
            case 4: return SCANNING;
            case 5: return PACKAGING;
            case 6: return SHIP;
            case 7: return COMPLETE;
            case 8: return ON_CANCEL;
            case 9: return CANCELED;
            case 10:return CANCEL_FAIL;
            default:return UNPAID;
        }
    }

}
